package kodkod.analysis.ast;

import java.util.ArrayList;

import kodkod.ast.Node;

public class wCompoundNode extends wNode {
	
	ArrayList<wNode> members = new ArrayList<wNode>();

	public wCompoundNode(wGraph graph, Node node) {
		super(graph, node);
	}
	
	public void addMember(wNode node) {
		node.compound = this;
		members.add(node);
	}
	
	public String getLabel() {
		StringBuffer buf = new StringBuffer();
		buf.append("{");
		buf.append("<N" + getId() + "> " + getName(node));
		for (wNode member : members) {
			buf.append("| <N" + member.getId() + "> " + member.getName(member.node));
		}
		buf.append("}");
		return buf.toString();
	}

}
